using System;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "LinearRingType")]
	public class LinearRing : GeometryElementsGeometry
	{
		private CoordinateList coords;

        public LinearRing()
		{
            this.coords = new CoordinateList();
		}

		[XmlElement(ElementName = "coordinates", Type = typeof(CoordinateList))]
        public CoordinateList Coordinates
		{
            get { return this.coords; }
            set { this.coords = value; }
		}

        [XmlIgnore()]
        public Coordinate[] CoordinateArray
        {
            get { return this.coords.ToArray(); }
            set { this.coords = new CoordinateList(value); }
        }

        [XmlIgnore()]
        public string CoordinateString
        {
            get { return this.coords.ToString(); }
            set { this.coords = new CoordinateList(value); }
        }
    }
}